import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

//TIP 要<b>运行</b>代码，请按 <shortcut actionId="Run"/> 或
// 点击装订区域中的 <icon src="AllIcons.Actions.Execute"/> 图标。
public class httpServer {
    public static void main(String[] args) throws IOException {

        ServerSocket socket = new ServerSocket(8080);
       Socket accept = socket.accept();
        InputStream is = accept.getInputStream();

        byte[] bytes = new byte[1024000];
        int len = is.read(bytes);
        String str = new String(bytes,0,len);
        System.out.println(str);

        //释放资源
        accept.close();
        socket.close();
        is.close();
    }
}